package qdu.edu.com.fushanf4.item_desc_dataset.txt.distinct;

import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import qdu.edu.com.fushanf4.service.count.usertype.search2characters.splicingtwocharacters.SplicingTwoCharactersReducer;
import qdu.edu.com.fushanf4.utils.ConfigurationUtil;
import qdu.edu.com.fushanf4.utils.DriverUtil;

import java.io.IOException;

public class ProductDistinctDriver extends DriverUtil {
    public static void main(String[] args) throws IOException {
        ProductDistinctDriver productDistinctDriver = new ProductDistinctDriver();
        productDistinctDriver.run(args);
    }

    @Override
    public Job runJob(String[] path) throws IOException {
        Job job = ConfigurationUtil.getJob();

        job.setJarByClass(ProductDistinctDriver.class);

        job.setMapperClass(ProductDistinctMapper.class);
        job.setReducerClass(SplicingTwoCharactersReducer.class);

        job.setMapOutputKeyClass(Text.class);
        job.setMapOutputValueClass(NullWritable.class);

        job.setOutputKeyClass(Text.class);
        job.setOutputValueClass(NullWritable.class);

        assert ConfigurationUtil.setPathAndRunJob(path,job);
        //返回job
        return job;
    }
}
